RCS Calculation with Ray Tracing

This is an example of using RadarSimPy to get the radar cross section (RCS) of a 3-D object model. Ray-Tracing/Shoot-and-Bounce-Rays method is used in RadarSimPy. The ray-tracing engine RadarSimC, which is built with C++, is integrated in RadarSimPy.

RadarSimPy is a radar simulation package built with python. Contact me if you are interested in this module.

This notebook is available on my GitHub.


Example with a corner reflector

The corner reflector model is with .stl. It can be imported by using numpy-stl module.

In [1]:
import numpy as np
from stl import mesh
import plotly.graph_objs as go
from plotly.offline import iplot

mesh_data = mesh.Mesh.from_file('../models/cr.stl')

x = np.ravel(mesh_data.vectors[:, :, 0])
y = np.ravel(mesh_data.vectors[:, :, 1])
z = np.ravel(mesh_data.vectors[:, :, 2])

cr = go.Mesh3d(x=x, y=y, z=z, opacity=1,
               i=np.arange(0, np.shape(mesh_data.vectors)[0]*3, 3),
               j=np.arange(1, np.shape(mesh_data.vectors)[0]*3, 3),
               k=np.arange(2, np.shape(mesh_data.vectors)[0]*3, 3),
               )

fig = go.Figure(data=[cr])
iplot(fig)

The RCS calculation function is rcs_sbr

In [2]:
from radarsimpy import rcs_sbr

RCS vs frequency

Define the basic parameters required in ray tracing.

  • Observation angle phi (Degree)
  • Observation angle theta (Degree)
  • Frequency freq (Hz)
  • Polarization pol
  • Ray density density (number of rays per wavelength)
In [3]:
import time

phi = 90
theta = 90
freq = np.arange(1, 78, 1)*1e9
pol = [0, 0, 1]
density = 10

rcs = np.zeros_like(freq)

tic = time.time()
for f_idx, f in enumerate(freq):
    rcs[f_idx] = 10*np.log10(rcs_sbr('../models/cr.stl', phi,
                                     theta, f, pol=pol, density=density))
toc = time.time()

Execution time with Arch Linux (kernel 5.4.15, Intel Core i3-6100U, 8 GB RAM)

In [4]:
print('Execution time:', toc-tic, 's')
Execution time: 3.6885581016540527 s
In [5]:
data = go.Scatter(x=freq/1e9, y=rcs)

layout = go.Layout(
    title='RCS vs Frequency',
    yaxis=dict(title='RCS (dBsm)'),
    xaxis=dict(title='Frequency (GHz)'),
)
fig = go.Figure(data=data, layout=layout)
iplot(fig)

RCS vs observation angle

In [6]:
phi = np.arange(0, 180, 0.5)
theta = 90
freq = 60e9
pol = [0, 0, 1]
density = 10

rcs = np.zeros_like(phi)

tic = time.time()
for phi_idx, phi_ang in enumerate(phi):
    rcs[phi_idx] = 10 * \
        np.log10(rcs_sbr('../models/cr.stl', phi_ang, theta, freq, pol=pol, density=density))
toc = time.time()

Execution time with Arch Linux (kernel 5.4.15, Intel Core i3-6100U, 8 GB RAM)

In [7]:
print('Execution time:', toc-tic, 's')
Execution time: 18.462117433547974 s
In [8]:
data = go.Scatter(x=phi, y=rcs)

layout = go.Layout(
    title='RCS vs Observation Angle',
    yaxis=dict(title='RCS (dBsm)'),
    xaxis=dict(title='Observation angle phi (Degree)'),
)
fig = go.Figure(data=data, layout=layout)
iplot(fig)

Example with Audi R8

The Audi R8 model is also with .stl.

In [9]:
mesh_data = mesh.Mesh.from_file('../models/audi_r8.stl')

x = np.ravel(mesh_data.vectors[:, :, 0])
y = np.ravel(mesh_data.vectors[:, :, 1])
z = np.ravel(mesh_data.vectors[:, :, 2])

audi = go.Mesh3d(x=x, y=y, z=z, opacity=1,
                 i=np.arange(0, np.shape(mesh_data.vectors)[0]*3, 3),
                 j=np.arange(1, np.shape(mesh_data.vectors)[0]*3, 3),
                 k=np.arange(2, np.shape(mesh_data.vectors)[0]*3, 3),
                 )

fig = go.Figure(data=[audi])
iplot(fig)

RCS vs observation angle

In [10]:
phi = np.arange(0, 360, 1)
theta = 90
freq = 1.5e9
pol = [0, 0, 1]
density = 10

rcs = np.zeros_like(phi)

tic = time.time()
for phi_idx, phi_ang in enumerate(phi):
    rcs[phi_idx] = 10 * \
        np.log10(rcs_sbr('../models/audi_r8.stl', phi_ang, theta, freq, pol=pol, density=density))
toc = time.time()

Execution time with Arch Linux (kernel 5.4.15, Intel Core i3-6100U, 8 GB RAM)

In [11]:
print('Execution time:', toc-tic, 's')
Execution time: 52.64167404174805 s
In [12]:
data = go.Scatter(x=phi, y=rcs)

layout = go.Layout(
    title='RCS vs Observation Angle',
    yaxis=dict(title='RCS (dBsm)'),
    xaxis=dict(title='Observation angle phi (Degree)'),
)
fig = go.Figure(data=data, layout=layout)
iplot(fig)